package leeon.bbsbrower.actions;

import leeon.bbsbrower.util.PropertyLoader;
import leeon.bbsbrower.views.DocView;
import leeon.bbsbrower.views.MailListView;

public class Config {
	
	public static final String PATH_SETTING_FILE = "conf/setting.conf";
	
	public static String PROXY_SERVER = null;
	
	public static String PROXY_PORT = null;
	
	public static String PROXY_USER = null;
	
	public static String PROXY_PASSWORD = null;
	
	public static String SERVER_URL = "http://bbs.fudan.edu.cn";
	
	public static String SERVER_CGI = "/cgi-bin/bbs/";
	
	public static int STATUS_REFRESH = 600;  
	
	public static int MSG_REFRESH = 30;
	
	public static boolean MAIL_BACKUP = false;
	
	public static String MAIL_SIGN = "0"; 
	
	public static String DOC_SIGN = "0";
	
	public static int SCREEN_SIZE_H = 768;
	
	public static int SCREEN_SIZE_W = 1024;
	
	public static boolean MYBOARD_LOCAL = true;
	
	static {
		PropertyLoader p = PropertyLoader.newInstance(PATH_SETTING_FILE);
		PROXY_SERVER = p.getProperty("proxy.server");
		PROXY_PORT = p.getProperty("proxy.port");
		PROXY_USER = p.getProperty("proxy.user");
		PROXY_PASSWORD = p.getProperty("proxy.password");
		
		SERVER_URL = p.getProperty("server.url", "http://bbs.fudan.edu.cn");
		SERVER_CGI = p.getProperty("server.cgi", "/cgi-bin/bbs/");
		
		DocView.size = Integer.parseInt(p.getProperty("client.docsize", "30"));
		MailListView.size = Integer.parseInt(p.getProperty("client.mailsize", "19"));
		STATUS_REFRESH = Integer.parseInt(p.getProperty("client.status.refresh", "600"));
		MSG_REFRESH = Integer.parseInt(p.getProperty("client.msg.refresh", "30"));
		MAIL_BACKUP = "true".equals(p.getProperty("client.mail.backup", "false"));
		MAIL_SIGN = p.getProperty("client.mail.sign", "0");
		DOC_SIGN = p.getProperty("client.doc.sign", "0");
		
		SCREEN_SIZE_W = Integer.parseInt(p.getProperty("client.screen.width", "1024"));
		SCREEN_SIZE_H = Integer.parseInt(p.getProperty("client.screen.height", "768"));
		
		MYBOARD_LOCAL = "true".equals(p.getProperty("client.myboard.local", "true"));
	}	
}
